// store/modules/authorization.js
const authorizationModule = {
  state: {
    time: '',
    platform: '',
    age_limit:'',
    authorization_fee:'',
  },
  mutations: {
    updateAuthorization(state, payload) {
      state.time = payload.time;
      state.platform = payload.platform;
      state.age_limit = payload.age_limit;
      state.authorization_fee = payload.authorization_fee;
    }
  },
  actions: {
    setAuthorization({ commit }, payload) {
      commit('updateAuthorization', payload);
    }
  },
  getters: {
    getAuthorization(state) {
      return {
        time: state.time,
        platform: state.platform,
        age_limit: state.age_limit,
        authorization_fee: state.authorization_fee,
      };
    }
  }
};

// 创建合并的 store
import { createStore } from 'vuex';

const store = createStore({
  modules: {
    authorization: authorizationModule,
  }
});

export default store;
